package com.example.aotdemo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class UserDao {


    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void insertUser(User user){
        String sql = "insert into user_tb(id, uname, password) values(?, ?, ?)";
        jdbcTemplate.update(sql, user.getId(), user.getUname(), user.getGengder());
    }
}
